package org.xlp.base.application.context;

import org.xlp.base.application.service.BatchBaseService;
import org.xlp.base.application.util.ApplicationPropertiesUtils;
import org.xlp.bean.base.IBeanDefinition;
import org.xlp.bean.impl.DefaultBeansContainer;
import org.xlp.mvc.definition.ServiceAnnotationBeanDefinition;

/**
 * Description: 扩展bean创建实现
 * <br/>date: 2024/12/4 19:19
 *
 * @version 1.0
 * @author: xlp
 */
class ApplicationBeansContainer extends DefaultBeansContainer {
    public ApplicationBeansContainer() {
        addBeanDefinition(new ServiceAnnotationBeanDefinition(BatchBaseService.class));
    }

    /**
     * bean属性初始化后置处理扩展
     *
     * @param bean
     * @param beanDefinition
     */
    @Override
    protected void afterInitBeanAttributeProcess(Object bean, IBeanDefinition beanDefinition) {
        super.afterInitBeanAttributeProcess(bean, beanDefinition);
        ApplicationPropertiesUtils.initBean(bean, beanDefinition.getBeanClass());
    }
}
